package pub.guoxin.oops.manager.vo;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import pub.guoxin.oops.model.AlarmInfo;
import pub.guoxin.oops.tidy.LocalDateTimeDeserializer;
import pub.guoxin.oops.tidy.LocalDateTimeSerializer;

import java.time.LocalDateTime;

/**
 * Create by guoxin on 2018/5/6
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class AlarmInfoStatisticsVo {
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    private LocalDateTime creation;

    private Object value;

    public AlarmInfoStatisticsVo(AlarmInfo alarmInfo) {
        this.creation = alarmInfo.getCreation();
        this.value = alarmInfo.getValue();
    }
}
